home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / SelectSequence / SelectSequence.rexx < prev   
OS/2 REXX Batch file  |  1996-06-22  |  2KB  |  65 lines

  1. /*
  2. ** SelectSequence.rexx for DirectoryOpus 4
  3. **
  4. ** written by Marcin Orlowski <carlos@dedal.man.szczecin.pl>
  5. **                            <http://dedal.man.szczecin.pl/~carlos>
  6. **
  7. ** $VER 1.1
  8. **
  9. ** Brief: This script lets you easily select file sequences.
  10. ** Usage: Just select one file out of the sequence and call this script. 
  11. ** SetUp: Copy this script whereever on your disk (suggested DOpus:Rexx or REXX:Dopus)
  12. **        and then add button (menu, hotkey):
  13. **
  14. **        (ARexx) REXX:DOpus/SelectSequence.rexx
  15. **
  16. ** Limitations: This scripts requires that the sequence is named using the following
  17. **              format: AAAAAA.XXX where AAAAA means any character (letter, digit)
  18. **              XXX means digits. The dot separator (.) may be replaced by any char
  19. **              but NON-DIGIT! Sequence named XXX only (eg: 0001, 0002...) will be
  20. **              processed correctly.
  21. **
  22. ** © W.F.M.H. v1.0 - Mon Jun 17 14:32:14 1996
  23. **            v1.1 - Sat Jun 22 12:22:37 1996
  24. */
  25.  
  26. OPTIONS RESULTS
  27.  
  28. DOPUSToFront
  29.  
  30. Status 3                 /* get number of the active window */
  31. ActiveWindow = RESULT
  32.  
  33. GetSelectedFiles '"/"' ActiveWindow
  34. SelectedFiles = RESULT || "/"
  35.  
  36. WordStart = 1
  37. WordEnd   = 2
  38.  
  39. Status 7 ActiveWindow     /* how many selected files in the active window */
  40. Licznik = RESULT
  41.  
  42. SAY licznik
  43.  
  44. IF Licznik > 0 THEN
  45.     DO Licznik
  46.         WordEnd  = POS('/', SelectedFiles, WordEnd);
  47.         FileName = SUBSTR(SelectedFiles, WordStart, WordEnd-WordStart)
  48.         NameLen  = LENGTH(FileName)
  49.  
  50.         WordEnd   = WordEnd + 1
  51.         WordStart = WordEnd
  52.  
  53.         DO DotPos = NameLen TO 1 BY -1
  54.             IF DATATYPE(SUBSTR(FileName, DotPos, 1), N) = 0 THEN LEAVE
  55.         END
  56.  
  57.         DO
  58.             BaseName = LEFT(LEFT(FileName, DotPos), NameLen, '?')
  59.             'Select 'BaseName' 'ONLYFILES''
  60.         END
  61.     END
  62. ELSE
  63.  
  64.  TopText "Select any file first!"
  65.